package com.itsv.cyzx.util;

import java.io.InputStream;

import org.apache.http.util.EncodingUtils;

import android.content.Context;

public class StringUtil {
	public static String getStrForJson(String fileName,Context context){
		String res=""; 
		try{ 
		   InputStream in = context.getResources().getAssets().open(fileName);
		   // \Test\assets\yan.txt这里有这样的文件存在
		   int length = in.available();         
		byte [] buffer = new byte[length];        
		in.read(buffer);            
		res = EncodingUtils.getString(buffer, "gbk");     
		}catch(Exception e){ 
		      e.printStackTrace();         
		   }
		return res;
	}
}
